//var mysql      = require('mysql');
//var connection = mysql.createConnection({
//    host     : 'localhost',
//    user     : 'root',
//    database : 'ordermaster',
//    port     : 3306
//});
console.log(99999)
function Person(name){
    this.name = name
}

Person.prototype.get = function(){
    var name = this.name
    console.log(name)
}

var person1 = new Person("大猫")
//person1.get()



//connection.connect();
//connection.query('select * from  person', function (err, rows) {//account 用户账户表
//    if (err) throw err;
//    console.log(rows[2].name);
//});
//connection.query('select * from restaurant where RestaurantName ="KFC" ', function (err, rows) {
//    console.log(rows)
//})
//var updateSQL = 'update person set name="大da",meal="大大"  where id=3';
//connection.query(updateSQL, function (err3, res3) {
//    if (err3) console.log(err3);
//    console.log("UPDATE Return ==> ");
//    console.log(res3);
//});

//connection.end();



//var findAndUpdateTest = function(cb) {
//    connection.connect(function(conn, cb) {
//        cps.seq([
//            function(_, cb) {
//                person.Table.findById(conn, 3, cb);
//            },
//            function(user, cb) {
//                var dto = {
//                    'meal': 'Morgan'
//                };
//                user.update(conn, dto, cb);
//            }
//        ], cb);
//    }, cb);
//};

//connection.end()











//var mongoose = require('mongoose')
//    , Schema = mongoose.Schema;
//var db = mongoose.createConnection('localhost','test');

//mongoose.connect('mongodb://localhost/data');

//1.定义schema，也就是传统意义的表结构
//var BlogSchema = new Schema({
//    id :String,
//    user_id        : {type : Number, index : true}
//    ,username       : {type : String}
//});
//2.定义model
//mongoose.model("Blog", BlogSchema,"list_info");
//mongoose.model("Blog", BlogSchema,"BLOG");  model名，绑定的schema，db collection名

//3.日常操作

//var Blog = mongoose.model("Blog"); //获得model实例

//var blog1 = new Blog();
//blog1.id = 4;
//blog1.title="ully";
//blog1.name="pppp";
//blog1.username = "rrrrr"
//
//blog1.save(function(err) {  //存储
//    if (err) {
//        console.log('save failed');
//    }
//    console.log('save success');
//});

//Blog.find({name:"meal_list"},function(err,docs){
//    console.log(docs);
//});

//Blog.remove({id:4},function(err,docs){
//    console.log(docs);
//});
//
//Blog.update({id:4,title:"ulii"},function(err,docs){
//    console.log(docs);
//});